package com.cis.education.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cis.education.mapper.EduCourseStudentMapper;
import com.cis.education.domain.EduCourseStudent;
import com.cis.education.service.IEduCourseStudentService;
import com.cis.common.core.text.Convert;

/**
 * 学生和课程关联Service业务层处理
 * 
 * @author 管理员
 * @date 2022-01-18
 */
@Service
public class EduCourseStudentServiceImpl implements IEduCourseStudentService 
{
    @Autowired
    private EduCourseStudentMapper eduCourseStudentMapper;

    /**
     * 查询学生和课程关联
     * 
     * @param courseId 学生和课程关联主键
     * @return 学生和课程关联
     */
    @Override
    public EduCourseStudent selectEduCourseStudentByCourseId(Long courseId)
    {
        return eduCourseStudentMapper.selectEduCourseStudentByCourseId(courseId);
    }

    /**
     * 查询学生和课程关联列表
     * 
     * @param eduCourseStudent 学生和课程关联
     * @return 学生和课程关联
     */
    @Override
    public List<EduCourseStudent> selectEduCourseStudentList(EduCourseStudent eduCourseStudent)
    {
        return eduCourseStudentMapper.selectEduCourseStudentList(eduCourseStudent);
    }

    /**
     * 新增学生和课程关联
     * 
     * @param eduCourseStudent 学生和课程关联
     * @return 结果
     */
    @Override
    public int insertEduCourseStudent(EduCourseStudent eduCourseStudent)
    {
        return eduCourseStudentMapper.insertEduCourseStudent(eduCourseStudent);
    }

    /**
     * 修改学生和课程关联
     * 
     * @param eduCourseStudent 学生和课程关联
     * @return 结果
     */
    @Override
    public int updateEduCourseStudent(EduCourseStudent eduCourseStudent)
    {
        return eduCourseStudentMapper.updateEduCourseStudent(eduCourseStudent);
    }

    /**
     * 批量删除学生和课程关联
     * 
     * @param courseIds 需要删除的学生和课程关联主键
     * @return 结果
     */
    @Override
    public int deleteEduCourseStudentByCourseIds(String courseIds)
    {
        return eduCourseStudentMapper.deleteEduCourseStudentByCourseIds(Convert.toStrArray(courseIds));
    }

    /**
     * 删除学生和课程关联信息
     * 
     * @param courseId 学生和课程关联主键
     * @return 结果
     */
    @Override
    public int deleteEduCourseStudentByCourseId(Long courseId)
    {
        return eduCourseStudentMapper.deleteEduCourseStudentByCourseId(courseId);
    }
}
